package com.wanmait.recruitment.service.impl;

import com.github.pagehelper.PageInfo;
import com.wanmait.recruitment.mapper.NatureMapper;
import com.wanmait.recruitment.pojo.Nature;
import com.wanmait.recruitment.service.NatureService;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;
@Service
@Transactional(rollbackFor = Exception.class)
public class NatureServiceImpl implements NatureService {
    @Resource
    private NatureMapper natureMapper;
    @Override
    //@CacheEvict(value = "natureCache",allEntries = true)
    public void insert(Nature object) {
        natureMapper.insertSelective(object);
    }

    @Override
    //@CacheEvict(value = "natureCache",allEntries = true)
    public void delete(Integer id) {
        natureMapper.updateByPrimaryKey(id);
    }

    @Override
    public void delete(String ids) {

    }

    @Override
    //@CacheEvict(value = "natureCache",allEntries = true)
    public void update(Nature object) {
        natureMapper.updateByPrimaryKeySelective(object);
    }

    @Override
    public Nature findById(Integer id) {
        return null;
    }
    //查询所有工作性质
    @Override
    //@Cacheable("natureCache")
    public List<Nature> findAll() {
        return natureMapper.findAll();
    }

    @Override
    public List<Nature> findAll(Nature object) {
        return null;
    }

    @Override
    public PageInfo<Nature> findPage(int pageNum, int pageSize) {
        return null;
    }
}
